const { DataTypes } = require('sequelize')

const seq = require('../db/seq')
const Role = require('./role.model')
const EmpRole = require('./empRole.model')

const Employee = seq.define('employee', {
    id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
    phone: DataTypes.STRING,
    password: DataTypes.STRING,
    empName: DataTypes.STRING,
    gender: DataTypes.INTEGER,
    onDuty: DataTypes.TINYINT,
    birth: DataTypes.DATEONLY,
    entryTime: DataTypes.DATEONLY,
    education: DataTypes.STRING,
    politicalStatus: DataTypes.STRING,
    nativePlace: DataTypes.STRING,
    leaveTime: DataTypes.DATEONLY

}, {
    tableName: 'employee'
})
// Employee.belongsToMany(Role, {
//     through: EmpRole
// })
module.exports = Employee